
# 类相当于一个模板
# 对象就是根据这个模板创建的一个具体的实例

class Dianying:
    def __init__(self, name, price, duration):
        self.name = name
        self.price = price
        self.duration = duration

dianying1 = Dianying('满江红', 100, 180)
dianying2 = Dianying('流浪地球', 80, 150)
dianying3 = Dianying('无名', 70, 120)

print(dianying1.name)

dianying_list = []
for x in range(1000):
    id = x + 1
    dianying = Dianying(f'电影_{id}', id, 180)
    dianying_list.append(dianying)

print(dianying_list)



